// 自定义 Promise
class MyPromise {
  constructor(executor) {
    if (typeof executor !== "function") {
      throw new Error(
        "MyPromise resolver " + typeof executor + "is not a function!"
      );
    }

    this.status = "pending";
  }
}

try {
  new MyPromise(function (resolve, reject) {
    setTimeout(() => {
      resolve();
    }, 1e3);
  });
} catch (error) {
  console.log(error.message);
}
